import request from '../../utils/request';

// 会员签到管理相关 API

// 会员签到
export const memberSignIn = (data: any) => {
    return request({
        url: '/member/api/member-sign-in',
        method: 'post',
        data
    });
};

// 查询连续签到天数
export const getConsecutiveSignInDays = (memberId: string) => {
    return request({
        url: `/member/api/member-sign-in/consecutive/${memberId}`,
        method: 'get'
    });
};

// 补签
export const makeupSignIn = (memberId: string, data: any) => {
    return request({
        url: `/member/api/member-sign-in/makeup/${memberId}`,
        method: 'post',
        data
    });
};

// 查询会员签到记录
export const getMemberSignInRecords = (memberId: string) => {
    return request({
        url: `/member/api/member-sign-in/member/${memberId}`,
        method: 'get'
    });
};

// 查询本月签到次数
export const getMonthlySignInCount = (memberId: string) => {
    return request({
        url: `/member/api/member-sign-in/monthly-count/${memberId}`,
        method: 'get'
    });
};

// 分页查询签到记录
export const getSignInPage = (params: any) => {
    return request({
        url: '/member/api/member-sign-in/page',
        method: 'get',
        params
    });
};

// 查询签到统计信息
export const getSignInStats = (memberId: string) => {
    return request({
        url: `/member/api/member-sign-in/stats/${memberId}`,
        method: 'get'
    });
};

// 查询今日是否已签到
export const getTodaySignInStatus = (memberId: string) => {
    return request({
        url: `/member/api/member-sign-in/today/${memberId}`,
        method: 'get'
    });
};

// 查询总签到次数
export const getTotalSignInCount = (memberId: string) => {
    return request({
        url: `/member/api/member-sign-in/total-count/${memberId}`,
        method: 'get'
    });
};
